﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ProgrammingSchool.Core.Models
{
    public class ServiceResult<T>
    {
        public ServiceResult()
        {
            State = StateEnum.Success;
            ErrorMessage = string.Empty;
        }

        public ServiceResult(StateEnum state, string errorMessage, T result)
        {
            State = state;
            ErrorMessage = errorMessage;
            Result = result;
        }

        public StateEnum State { get; set; }
        public string ErrorMessage { get; set; }
        public T Result { get; set; }
    }

    public class ServiceResult
    {
        public ServiceResult()
        {
            State = StateEnum.Success;
            ErrorMessage = string.Empty;
        }

        public ServiceResult(StateEnum state, string errorMessage)
        {
            State = state;
            ErrorMessage = errorMessage;
        }

        public StateEnum State { get; set; }
        public string ErrorMessage { get; set; }
    }
}
